Re: menuitem activate



If you know what action you want to invoke, you can also
call the callback function of the item directly (or some
other function that performs the requested action), can't
you?

I guess it'll be shorter to start from the beginning.  I'm messing around with
GimageView 0.2.27.  I want it to auto-refresh the directory tree as new things
are added to the directory it starts from with the command line switches.

I can loop the reading of the directory all day, but if I do that the
refreshes take place before the program is ever drawn to the screen.  Not good.

I cannot do anything actively until after the program is drawn on the screen.

I can make the single click on the refresh button loop as often as I care to
do so.  Still, requires a click of the mouse.  How to eliminate that click.

I've put in a method (function?) that uses dnotify to print "something added"
and "something changed" in the starting xterm at the appropriate times.  Cool,
now I've got the automated part of notification done.

All I want it to do is refresh the directory side of the screen whenever
there's a change in the directories I've chosen.  There's already a refresh
directory method available.

I would love to call 
static void cb_refresh_dir_tree (DirView *dv, guint action, GtkWidget *menuitem)
directly, but I have no idea what the pointer to dv needs to be.  Well, what
does the call back call?

refresh_dir_tree (dv, &iter);
Well, that's no help in the least, I STILL don't know what that *dv is or what
it needs to be.  I know the iteration (&iter) can be NULL and that works for
what I'm doing but what the heck is that dv?

Okay, so without that, how do I tell the program that the "Refresh Directory
Tree" button has been pushed and let IT figure out what the heck needs to go
where.

Then we end up with my original question about gtk_button_clicked().  When I
looked further into the program, it's not actually a button, it's a GtkWidget:

static void cb_refresh_button               (GtkWidget    *widget

I tried making that one a GtkButton *button and that worked for the button
still working but I still could not figure out how to press it inside the
program from the dnotify.

So, digging some more I find that the deprecated menuitem setup is what is
being used in the popup as well as the main menu and both have calls to
refresh the directory tree.  All I have to do is make the program believe one
of those has been clicked and it'll refresh.

and here's where I sit, knowing that, having a good idea about what I need to
do to make it work but unable to figure out what the heck the actual call is.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]